package cn.platform.mapper;

import cn.platform.entity.Clazz1;
//import cn.platform.request.ClassQueryDTO;
//import cn.platform.request.ClazzDetailDTO;
//import cn.platform.response.ClassVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ClazzMapper1 {
    @Select("select id from jxt_classes where grade_year=#{gradeYear} and class_num=#{classNum}")
    String getClassIdByGradeAndClassNum(int gradeYear, Integer classNum);

//    Page<ClassVO> page(ClassQueryDTO classQueryDTO);

//    ClazzDetailDTO getClassById(String id);

    void insert(Clazz1 clazz1);

    void update(Clazz1 clazz1);

    @Select("select grade_year from jxt_classes where id=#{id}")
    Integer getGradeYearById(String id);

    @Delete("delete from jxt_classes where id=#{id}")
    void deleteById(String id);

    List<Integer> getGradeYearByIds(List<String> ids);

    @Select("select class_num from jxt_classes where id=#{classID}")
    String getClassNumById(String classID);


    //学生成绩关联
    @Select("select * from jxt_classes where id=#{classID}")
    Clazz1 getById(Object classId);
}
